﻿namespace Jim.OA.Service;

/// <summary>
/// 个人流程查询
/// </summary>
/// <remarks>查询用户待办、已办等流程列表</remarks>    
[ApiDescriptionSettings(ApplicationConst.GroupName)]
public  class OAWorkflowQueryService : IDynamicApiController, ITransient
{
    private readonly OAClientFactory _oaClientFactory;
    public OAWorkflowQueryService(OAClientFactory oaClientFactory)
    {
        _oaClientFactory = oaClientFactory;
    }

    #region 待办流程
    /// <summary>
    /// 根据tabids 来获取流程数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    //[ApiDescriptionSettings(Name = "getToDoRequestCount", Order = 8699, Tag = "个人流程查询",Description = "")]
    public async Task<OAGetRequestCountOutput> GetToDoRequestCount([FromQuery] OAGetToDoByTabRequestCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 根据 tabids 来获取流程列表 (对外)
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetToDoByTabIdRequestList([FromQuery] OAGetToDoByTabIdRequestListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 已办流程
    /// <summary>
    /// 获取已办流程数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetHandledWorkflowRequestCount([FromQuery] OAGetHandledRequestCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取已办流程列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetHandledWorkflowRequestList([FromQuery] OAGetHandledRequesListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 办结流程
    /// <summary>
    /// 获取办结流程数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetProcessedWorkflowRequestCount([FromQuery] OAGetProcessedRequestCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取办结流程列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetProcessedWorkflowRequestList([FromQuery] OAGetProcessedRequesListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }


    #endregion

    #region 所有发起流程
    /// <summary>
    /// 获取所有发起流程数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetMyWorkflowRequestCount([FromQuery] OAGetMyRequestCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取所有发起流程列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetMyWorkflowRequestList([FromQuery] OAGetMyRequesListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 待办中退回
    /// <summary>
    /// 获取待办中退回的流程数据数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetBeRejectWorkflowRequestCount([FromQuery] OAGetBeRejectRequestCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取待办中退回的流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetBeRejectWorkflowRequestList([FromQuery] OAGetBeRejectRequestListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 待办中抄送
    /// <summary>
    /// 获取待办中抄送流程数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetCCWorkflowRequestCount([FromQuery] OAGetCCRequestCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取待办中抄送的流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetCCWorkflowRequestList([FromQuery] OAGetCCRequestListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 待处理
    /// <summary>
    /// 获取待处理的流程数据数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetDoingWorkflowRequestCount([FromQuery] OAGetDoingRequesCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取待处理的流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetDoingWorkflowRequestList([FromQuery] OAGetDoingRequestListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 转发(只统计还在待办的)
    /// <summary>
    /// 获取转发流程数量(只统计还在待办的)
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetForwardWorkflowRequestCount([FromQuery] OAGetForwardRequesCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取转发流程数据列表(只统计还在待办的)
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetForwardWorkflowRequestList([FromQuery] OAGetForwardRequestList input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 待阅
    /// <summary>
    /// 获取待阅流程数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetToBeReadWorkflowRequestCount([FromQuery] OAGetToBeReadRequesCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取待阅流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetToBeReadWorkflowRequestList([FromQuery] OAGetToBeReadRequestList input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 待办
    /// <summary>
    /// 获取待办流程数据数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetToDoWorkflowRequestCount([FromQuery] OAGetToDoRequesCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }
    /// <summary>
    /// 获取待办流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetToDoWorkflowRequestList([FromQuery] OAGetToDoRequestList input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

    #region 所有流程
    /// <summary>
    /// 获取所有流程数据数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetAllWorkflowRequestCount([FromQuery] OAGetAllRequesCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取待办流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestListOutput> GetAllWorkflowRequestList([FromQuery] OAGetAllRequestList input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    #endregion

}
